<template>
	<view class="list_box" v-for="(ele,index) in list" :key="index" @click="getNews(ele.url)">
		<view class="box_img">
			<p class="_img" :style="ele.style">
				<u-icon :name="ele.icon"></u-icon>
			</p>
			<p>
				{{ele.name}}
			</p>
		</view>
		<u-icon name="arrow-right"></u-icon>
	</view>
</template>

<script setup>
	const props = defineProps({
		list: {
			type: Object,
			default: () => {
				console.log(565455);
				return [{
					icon: "file-text-fill",
					name: "暂无数据",
					style: "background-color:red;"
				}];
			}
		}
	});

	const getNews = (url) => {
		uni.navigateTo({
			url: url
		});
	};
</script>

<style lang="scss" scoped>
	.list_box {
		width: 100%;
		display: flex;
		color: white;
		background-color: black;
		justify-content: space-between;
		align-items: center;
		padding: 0.5rem 1rem 0.5rem 1rem;
		box-sizing: border-box;
		margin-top: 0.5rem;
	}

	.box_img {
		display: flex;
		align-items: center;
		font-size: 35rpx;
	}

	._img {
		width: 3rem;
		height: 3rem;
		border-radius: 50%;
		margin-right: 2rem;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 2rem;
	}
</style>